<!-- 新建对话框 -->
<el-dialog
        v-loading="dialogLoading"
        element-loading-text="努力执行中"
        element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(0, 0, 0, 0.8)"
        :title="dialogTitle"
        :visible.sync="dialogVisible"
        width="66%"
        :close-on-click-modal="false"
        :before-close="handleClose">
  <el-form label-width="100px"

           ref="submitDialogFormRef"
           :model="formData"
           :rules="rules"
  >
    <el-row :gutter="20">
      <el-col :span="8">
        <el-form-item label="平台" prop="osDictId">
              <el-select v-model="formData.osDictId" placeholder="请选择平台" >
                <el-option
                        v-for="item in dicts[0].list"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id">
                </el-option>
              </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="部署方式" prop="deployTypeDictId">
              <el-select v-model="formData.deployTypeDictId" placeholder="部署方式" >
                <el-option
                        v-for="item in dicts[1].list"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id">
                </el-option>
              </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="8">
              <el-form-item label="技术类型" prop="techTypeDictId">
                  <el-select v-model="formData.techTypeDictId" placeholder="技术类型" >
                    <el-option
                            v-for="item in dicts[2].list"
                            :key="item.id"
                            :label="item.name"
                            :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
      </el-col>
    </el-row>

      <el-form-item label="标题" prop="title">
          <el-input v-model.trim="formData.title" placeholder="请输入标题" clearable ></el-input>
      </el-form-item>

    <el-row :gutter="20">
      <el-col :span="6">
        <el-form-item label="端口" prop="port">
          <el-input-number v-model.number="formData.port"  placeholder="端口"
                           :min="2024"
                           :max="65536"
                           :max-length="5"
            ></el-input-number>
        </el-form-item>
      </el-col>
        <el-col :span="4">
            <el-form-item label="加密" prop="encryptPassword">
                    <el-switch
                            v-model="formData.encryptPassword"
                            :active-value="1"
                            :inactive-value="0"
                            ></el-switch>
            </el-form-item>
        </el-col>
      <el-col :span="7">
              <el-form-item label="用户名" prop="username">
                  <el-input  :type=" formData.encryptPassword == 1 ? 'password' : 'text' "
                             v-model.trim="formData.username" placeholder="请输入用户名" clearable ></el-input>
              </el-form-item>
      </el-col>
        <el-col :span="7">
            <el-form-item label="密码" prop="password">
                <el-input  :type=" formData.encryptPassword == 1 ? 'password' : 'text' "
                           v-model.trim="formData.password" placeholder="请输入密码" clearable ></el-input>
            </el-form-item>
        </el-col>
    </el-row>
    <!--                                gcc-->

    <el-form-item label="链接" prop="url">
          <el-input v-model.trim="formData.url" placeholder="请输入链接" clearable ></el-input>
    </el-form-item>

 <el-form-item label="域名" prop="domain">
          <el-input v-model.trim="formData.domain" placeholder="请输入域名" clearable ></el-input>
      </el-form-item>

      <el-form-item v-if="dialogTitle == '编辑'" label="修改密码" >
          <el-radio-group v-model="formData.updatePasswordFlag">
              <el-radio :label="0">否</el-radio>
              <el-radio :label="1">是</el-radio>
          </el-radio-group>
      </el-form-item>

  </el-form>





  <span slot="footer" class="dialog-footer" >
        <el-button @click="handleClose">取 消</el-button>
        <el-button v-if="showBtnDialogFormSubmit" type="primary" @click="dialogFormSubmit">确 定</el-button>
    </span>

</el-dialog>



<el-dialog
        title="密码"
        :visible.sync="dialogVisiblePassword"
        width="33%"
        :close-on-click-modal="false"
        :before-close="handleClosePassword">

    <el-form label-width="100px"  >
        <el-form-item label="校验文件">
            <el-upload
                    class="upload-demo"
                    :action="pre + '/upload/file/common/upload'"
                    :headers="uploadHeaders"
                    :multiple="true"
                    :limit="3"
                    :on-success="fileUploadSuccess"
                    :file-list="fileList">
                <el-button size="small" type="primary">点击上传</el-button>
                <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
            </el-upload>
        </el-form-item>


        <div>
            <div style="display: flex; justify-content: flex-start;">
                    <el-form-item label="用户名">
                        <el-input v-model="passwordForm.username"></el-input>
                    </el-form-item>
                    <div><el-button @click="copyText(passwordForm.username)" style="margin-top: 6px;" type="success" size="mini">复制</el-button></div>
            </div>
            <div style="display: flex; justify-content: flex-start;">
                <el-form-item label="密码">
                    <el-input v-model="passwordForm.password"></el-input>
                </el-form-item>
                <div><el-button  @click="copyText(passwordForm.password)"   style="margin-top: 6px;"   type="success"  size="mini">复制</el-button></div>
            </div>
        </div>


    </el-form>

</el-dialog>